{extend name="public:layout" /}
{block name="content"}
<h4 class="text-success text-center">用户管理</h4>
<table class="table table-striped table-hover text-center">
    <tr>
        <td>ID</td>
        <td>用户名</td>
        <td>邮箱</td>
        <td>手机号</td>
        <td>注册时间</td>
        <td>身份</td>
        <td>状态</td>
        <td colspan="2">操作</td>
    </tr>
    {volist name="userList" id="user" empty="$empty"}
    <tr>
        <td>{$user.id}</td>
        <td>{$user.name}</td>
        <td>{$user.email}</td>
        <td>{$user.mobile}</td>
        <td>{$user.create_time}</td>
        <td>
            {eq name="$user.is_admin" value="0"}
            <span style="color: green">注册会员</span>
            {else/}
            <span style="color: red">超级管理员</span>
            {/eq}
        </td>
        <td>
            {eq name="$user.status" value="0"}
            <span style="color: green">正常</span>
            {else/}
            <span style="color: red">禁用</span>
            {/eq}
        </td>
        <td>
            {eq name="$user.id" value="$Think.session.admin_id"}
            <a href="{:url('userEdit',['id'=>$user.id])}">编辑</a>
            {/eq}
            {neq name="$user.id" value="$Think.session.admin_id"}
            <a href="{:url('doDelete',['id'=>$user.id])}" onclick="return confirm('确定要删除吗?')">删除</a>
            {/neq}
        </td>
    </tr>
    {/volist}
</table>
{/block}